import { request } from "../../request/request"
// pages/home/home.js
Page({
  data: {
    // 轮播图数据
    swiperList: [
      {goods_id:"1",image_src:"https://z3.ax1x.com/2021/06/03/23pRM9.jpg"},
    ],
    homeList: [
      // 菜单数据
      {
        className: "cateBox",
        id:"1",
        child: [
          { id: "5", img: "https://z3.ax1x.com/2021/06/03/21fxpD.png", title: "千分制查询", url: "/pages/home/system/index?params=system" },
          { id: "4", img: "https://z3.ax1x.com/2021/06/03/21fjfO.png", title: "获奖展示", url: "/pages/home/prize/index?params=prize" },
          { id: "3", img: "https://z3.ax1x.com/2021/06/03/21fgwq.png", title: "关于我们", url: "/pages/home/about/index?params=about" },
        ]
      },
      // 选项数据
      {
        className: "option",
        id:"2",
        child: [
          { id: "6", title: "千分制规则",  url: "/pages/home/rule/index?params=rule", img: "https://z3.ax1x.com/2021/06/03/215dFx.png" },
          { id: "2", title: "成绩查询", url: "/pages/home/achievement/index?params=achievement", img: "https://z3.ax1x.com/2021/06/03/215NwR.png" },
          { id: "7", title: "作品展示",  url: "/pages/home/works/index?params=works", img: "https://z3.ax1x.com/2021/06/03/215wY6.png" },
          { id: "1", title: "立即报名",  url: "/pages/home/signUp/index?params=signUp", img: "https://z3.ax1x.com/2021/06/03/215JOJ.png" },
          { id: "5", title: "指南",  url: "/pages/home/guide/index?params=guide", img: "https://z3.ax1x.com/2021/06/03/2158lF.png" },
          { id: "4", title: "消息",  url: "/pages/home/news/index?params=news", img: "https://z3.ax1x.com/2021/06/03/215tm9.png" },
          { id: "3", title: "客服",  url: "/pages/home/service/index?params=service", img: "https://z3.ax1x.com/2021/06/03/215Gy4.png" },
          { id: "8", title: "更多",  url: "/pages/home/more/index?params=more", img: "https://z3.ax1x.com/2021/06/03/21xE4g.png" },
        ]
      }
    ],
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.getSwiperList()
  },
  // 获取轮播图数据
  getSwiperList() {
    // request({ url: "/home/swiperdata" }).then(swiperList => this.setData({swiperList}))
  },
  // 获取导航栏数据 


  navi(e){
    console.log(e)
    const {url} = e.currentTarget.dataset
    console.log(e.currentTarget.dataset.url)
    wx.navigateTo({
      url,
      success: (result) => {
        console.log(result)
      },
      fail: () => {},
      complete: () => {}
    });
      
  }
})